/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.loja.view.component.composition.factory;

import br.com.loja.view.component.composition.CalendarToMany;
import br.com.loja.view.component.composition.CommonToMany;
import br.com.loja.view.component.composition.EntityToMany;
import br.com.loja.view.component.factory.ComponentFactory;
import java.awt.Component;

/**
 *
 * @author DavidLuiz
 */
public class CompositionToManyFactory extends ComponentFactory {

    public CompositionToManyFactory(Class<?> classType) {
        super(classType);
    }

    @Override
    public Component getComponent() {

        if (isCalendar()) {
            return new CalendarToMany();
        }
        if (isEntity()) {
            return new EntityToMany(getClassType());
        }

        return new CommonToMany(getClassType());

    }

}
